import { axios } from '@/utils/request'

const api = {
  cateTreeList: '/adminapi/subject/cateTreeList',
  cateList: '/adminapi/subject/cateList',
  cateAdd: '/adminapi/subject/cateAdd',
  cateEdit: '/adminapi/subject/cateEdit',
  cateDelete: '/adminapi/subject/cateDelete',
  cateDetail: '/adminapi/subject/cateDetail',
  setCateRank: '/adminapi/subject/setCateRank',
  versionList: '/adminapi/subject/versionList',
  versionAdd: '/adminapi/subject/versionAdd',
  versionEdit: '/adminapi/subject/versionEdit',
  versionDelete: '/adminapi/subject/versionDelete',
  versionDetail: '/adminapi/subject/versionDetail',
  setVersionRank: '/adminapi/subject/setVersionRank',
  versionOptions: '/adminapi/subject/versionOptions',
  subjectList: '/adminapi/subject/subjectList',


  subjectAdd: '/adminapi/subject/subjectAdd',
  subjectEdit: '/adminapi/subject/subjectEdit',
  subjectDelete: '/adminapi/subject/subjectDelete',
  subjectDetail: '/adminapi/subject/subjectDetail',
  setSubjectRank: '/adminapi/subject/setSubjectRank',
  getSubjectTree: '/adminapi/subject/subjectTree',
}

export default api

export function getCateTreeList(parameter) {
  return axios({
    url: api.cateTreeList,
    method: 'get',
    params: parameter
  })
}
export function getCateList(parameter) {
  return axios({
    url: api.cateList,
    method: 'get',
    params: parameter
  })
}
export function addCate(parameter) {
  return axios({
    url: api.cateAdd,
    method: 'post',
    data: parameter
  })
}
export function setCateRank(parameter) {
  return axios({
    url: api.setCateRank,
    method: 'post',
    data: parameter
  })
}
export function editCate(parameter) {
  return axios({
    url: api.cateEdit,
    method: 'post',
    data: parameter
  })
}
export function deleteCate(parameter) {
  return axios({
    url: api.cateDelete,
    method: 'post',
    data: parameter
  })
}
export function getCateDetail(parameter) {
  return axios({
    url: api.cateDetail,
    method: 'get',
    params: parameter
  })
}


export function versionList(parameter) {
  return axios({
    url: api.versionList,
    method: 'get',
    params: parameter
  })
}
export function versionAdd(parameter) {
  return axios({
    url: api.versionAdd,
    method: 'post',
    data: parameter
  })
}
export function versionEdit(parameter) {
  return axios({
    url: api.versionEdit,
    method: 'post',
    data: parameter
  })
}

export function versionDelete(parameter) {
  return axios({
    url: api.versionDelete,
    method: 'post',
    data: parameter
  })
}
export function versionDetail(parameter) {
  return axios({
    url: api.versionDetail,
    method: 'get',
    params: parameter
  })
}

export function setVersionRank(parameter) {
  return axios({
    url: api.setVersionRank,
    method: 'post',
    data: parameter
  })
}

export function versionOptions(parameter) {
  return axios({
    url: api.versionOptions,
    method: 'get',
    params: parameter
  })
}

export function subjectList(parameter) {
  return axios({
    url: api.subjectList,
    method: 'get',
    params: parameter
  })
}



export function subjectAdd(parameter) {
  return axios({
    url: api.subjectAdd,
    method: 'post',
    data: parameter
  })
}
export function subjectEdit(parameter) {
  return axios({
    url: api.subjectEdit,
    method: 'post',
    data: parameter
  })
}

export function subjectDelete(parameter) {
  return axios({
    url: api.subjectDelete,
    method: 'post',
    data: parameter
  })
}
export function subjectDetail(parameter) {
  return axios({
    url: api.subjectDetail,
    method: 'get',
    params: parameter
  })
}

export function setSubjectRank(parameter) {
  return axios({
    url: api.setSubjectRank,
    method: 'post',
    data: parameter
  })
}

export function getSubjectTree(parameter) {
  return axios({
    url: api.getSubjectTree,
    method: 'get',
    params: parameter
  })
}
